#ifndef __DATA_COLLECT_H__
#define __DATA_COLLECT_H__

#include <ros/ros.h>
#include "comm/comm_base.h"
#include "comm/comm_msg_nav_state.h"
#include "comm/comm_ros_base.h"
#include "lidar_data_collect.h"
#include "radar_data_collect.h"
#include "image_data_collect.h"

#include <pcl/point_cloud.h>
#include <pcl/point_types.h>

using namespace std;

/**************************************************************************************
功能描述: 数据采集
修改记录:
**************************************************************************************/
class DATA_COLLECT_C
{
public:
    DATA_COLLECT_C(ros::NodeHandle &nh)
          : nh_(nh),
            objLeftRs16LidarData_(nh, HEAD_LEFT_RS16_LIDAR),
            objLeftRsBpLidarData_(nh, HEAD_LEFT_RSBPEARL_LIDAR),
            objRightRsBpLidarData_(nh, HEAD_RIGHT_RSBPEARL_LIDAR),
            objMiddleRs16LidarData_(nh, MIDDLE_RS16_LIDAR),
            objMiddleRsBpLidarData_(nh, MIDDLE_RSBPEARL_LIDAR),
            objLeftRadarData_(nh, TOPIC_NAME_RADAR_LEFT_OBST),
            objFrontRadarData_(nh, TOPIC_NAME_RADAR_FRONT_OBST),
            objRightRadarData_(nh, TOPIC_NAME_RADAR_RIGHT_OBST),
            objBackRadarData_(nh, TOPIC_NAME_RADAR_BACK_OBST),
            
            objFrontUpperImageData_(nh, FRONT_UPPER_CAMERA_TOPIC),
            objFrontLowerImageData_(nh, FRONT_LOWER_CAMERA_TOPIC),
            objFrontLeftImageData_(nh, FRONT_LEFT_CAMERA_TOPIC),
            objFrontRightImageData_(nh, FRONT_RIGHT_CAMERA_TOPIC),
            objRearImageData_(nh, REAR_CAMERA_TOPIC),
            objRearLeftImageData_(nh, REAR_LEFT_CAMERA_TOPIC),
            objRearRightImageData_(nh, REAR_RIGHT_CAMERA_TOPIC),
            objTrafficLightImageData_(nh, TRAFFIC_LIGHT_CAMERA_TOPIC),
            
            objNavReceiver_(nh),
            objVelMsgReceiver_(nh),
            objCollectTimer_(1.0, false)
    {
    }

    ~DATA_COLLECT_C(){}

    int  Init();
    void DataCollect();

private:
    ros::NodeHandle&        nh_;
    
    LIDAR_DATA_COLLECT_C    objLeftRs16LidarData_;
    LIDAR_DATA_COLLECT_C    objLeftRsBpLidarData_;
    LIDAR_DATA_COLLECT_C    objRightRsBpLidarData_;
    LIDAR_DATA_COLLECT_C    objMiddleRs16LidarData_;
    LIDAR_DATA_COLLECT_C    objMiddleRsBpLidarData_;

    RADAR_DATA_COLLECT_C    objLeftRadarData_;
    RADAR_DATA_COLLECT_C    objFrontRadarData_;
    RADAR_DATA_COLLECT_C    objRightRadarData_;
    RADAR_DATA_COLLECT_C    objBackRadarData_;

    IMAGE_DATA_COLLECT_C    objFrontUpperImageData_;
    IMAGE_DATA_COLLECT_C    objFrontLowerImageData_;
    IMAGE_DATA_COLLECT_C    objFrontLeftImageData_;
    IMAGE_DATA_COLLECT_C    objFrontRightImageData_;
    IMAGE_DATA_COLLECT_C    objRearImageData_;
    IMAGE_DATA_COLLECT_C    objRearLeftImageData_;
    IMAGE_DATA_COLLECT_C    objRearRightImageData_;
    IMAGE_DATA_COLLECT_C    objTrafficLightImageData_;

    NAV_STATE_RECEIVER_C    objNavReceiver_;
    VEL_MSG_RECEIVER_C      objVelMsgReceiver_;

    TIMER_C                 objCollectTimer_;
    
    NAV_STATE_STRU          stNavState_;
};

#endif

